import myAxios from "@/axios";

// 请求图库类目列表
export function getPicCategory(page = 1, limit = 50) {
	return myAxios.get("/admin/image_class/" + page, {
		params: {
			limit,
		},
	});
}

// 请求指定类目的图片

export function getPicList(id, page = 1, limit = 10) {
	return myAxios.get("/admin/image_class/" + id + "/image/" + page, {
		params: {
			limit,
		},
	});
}
// 增加图库分类

export function addCategoryName(newName, order = 1) {
	return myAxios.post("/admin/image_class", {
		name: newName,
		order,
	});
}

// 请求修改类目名称
export function setCategoryName(id, name, order = 1) {
	return myAxios.post("/admin/image_class/" + id, {
		name: name,
		order,
	});
}

// 删除类目
export function delCategoryName(id) {
	return myAxios.post("/admin/image_class/" + id + "/delete");
}
